package usb;


public class Test03 {
    public static void main(String[] args) {
       int[] a ={5,9,6,7,2,1};
       int max = a[0];
       int min = a[0];
       for (int i = 0; i < a.length; i++) {
           if(a[i]>max){
               max = a[i];
           }
           if(a[i]<min){
               min = a[i];
           }
       }
       System.out.println("最大值为"+max);
       System.out.println("最小值为"+min);
    }
}
